import request from '@/utils/request'

let goodsListApi = {
  // 账号列表
  getGoodsList(data) {
    return request({
      url: '/goods/info/list',
      method: 'get',
      params: data
    })
  },
  // 导出列表
  exportGoodsList(data) {
    return request({
      url: '/goods/info/export',
      method: 'get',
      params: data
    })
  },
  //螃蟹导出
  exportGoodsListss(data) {
    return request({
      url: '/goods/info/exportPX',
      method: 'get',
      params: data
    })
  },

  // /goods/info/poollist 商户联盟 账号池列表
  getGoodsListPool(data) {
    return request({
      url: '/goods/info/poollist',
      method: 'get',
      params: data
    })
  },
  // /goods/info/poollist 商户联盟 我的账号列表
  myAccount(data) {
    return request({
      url: '/goods/info/myAccount',
      method: 'get',
      params: data
    })
  },
  getGoodsAllList(data) {
    return request({
      url: '/goods/info/allList',
      method: 'get',
      params: data
    })
  },
  // dange
  getGoodsDetail(id) {
    return request({
      url: `/goods/info/${id}`,
      method: 'get'
    })
  },
  // dange
  resetUnbind(id) {
    return request({
      url: `/goods/info/resetUnbind/${id}`,
      method: 'get'
    })
  },
  // dange
  toTop(id) {
    return request({
      url: `/goods/info/toTop/${id}`,
      method: 'get'
    })
  },
  // 转为已售
  toSaled(id) {
    return request({
      url: `/goods/info/toSaled/${id}`,
      method: 'get'
    })
  },
  // xinzeng
  addGoods(data) {
    return request({
      url: '/goods/info',
      method: 'post',
      data
    })
  },
  //
  editGoods(data) {
    return request({
      url: '/goods/info',
      method: 'put',
      data
    })
  },
  // 修改商品成本价
  editPrice(data) {
    return request({
      url: '/goods/info/editPrice',
      method: 'post',
      data
    })
  },
  // 删除商品
  delGoods(ids) {
    return request({
      url: `/goods/info/${ids}`,
      method: 'delete'
    })
  },
  //上架商品
  upGoods(id) {
    return request({
      url: `/goods/info/upGoods/${id}`,
      method: 'get'
    })
  },

  upGoodShop(params) {
    return request({
      url: `/goods/info/upGoods/two`,
      method: 'put',
      params
    })
  },
  //下架商品
  downGoods(data) {
    return request({
      url: `/goods/info/downGoods`,
      method: 'post',
      data
    })
  },
  //转为问题号
  problemGoods(data) {
    return request({
      url: `/goods/info/problemGoods`,
      method: 'post',
      data
    })
  },
  //转为找回账号
  retrieveGoods(data) {
    return request({
      url: `/goods/info/retrieveGoods`,
      method: 'post',
      data
    })
  },
  // 审核账号
  auditGoods(ids) {
    return request({
      url: `/goods/info/auditGoods/${ids}`,
      method: 'get'
    })
  },
  //goods/info/deleteAllAccount
  // 全部删除
  deleteAllAccount(data) {
    return request({
      url: `goods/info/deleteAllAccount`,
      method: 'get',
      params: data
    })
  },
  // 批量下架
  batchDown(ids) {
    return request({
      url: `/goods/info/down/${ids}`,
      method: 'get'
    })
  },
  // 销售端提号
  salePickUp(ids) {
    return request({
      url: `/goods/info/submitAccount/${ids}`,
      method: 'get'
    })
  },
  // 销售端提号新
  salePickUpNew(data) {
    return request({
      url: `goods/info/submitAccount`,
      method: 'post',
      data
    })
  },
  // 新增账号时推送渠道选择
  pushAllList() {
    return request({
      url: `/partner/partner/allList`,
      method: 'get'
    })
  },
  // 渠道分组列表
  pushGroupList() {
    return request({
      url: `/sale/group/list`,
      method: 'get'
    })
  },
  // 新增分组
  addPushGroup(data) {
    return request({
      url: `/sale/group`,
      method: 'post',
      data
    })
  },
  // 克隆商品
  goodsClone(id) {
    return request({
      url: `goods/info/copy/${id}`,
      method: 'get'
    })
  },

  // 编辑提号备注
  updateRemake(data) {
    return request({
      url: `goods/info/updateRemake`,
      method: 'post',
      data
    })
  },
  // 导出交易猫
  daochuJYM(data) {
    return request({
      url: `goods/info/exportJYM`,
      method: 'post',
      data
    })
  },
  //一键推送
  onejiantuisong(goodId, saleId) {
    return request({
      url: `jym/push/applyqrrecognize?goodId=${goodId}&saleId=${saleId}`,
      method: 'post'
    })
  },
  //获取二维码
  geterweimaTS(goodId, taskId, saleId) {
    return request({
      url: `jym/push/getqrrecognizeinfo?goodId=${goodId}&taskId=${taskId}&saleId=${saleId}`,
      method: 'post'
    })
  },
  //验证成功发布
  fabuerweimaTS(data) {
    return request({
      url: `jym/push/publishGoods`,
      method: 'post',
      data,
      timeout: 1000 * 60 * 2
    })
  },
  //删除获取任务
  deleteerweimaTS(taskId, saleId) {
    return request({
      url: `jym/push/deleteqrrecord?taskId=${taskId}&saleId=${saleId}`,
      method: 'post'
    })
  },
  // 商品复制
  copyGoods(goodsId){
    return request({
      url: `/goods/info/clone/${goodsId}`,
      method: 'put',
    })
  }
}
export default goodsListApi

